from selenium.webdriver.common.by import By
from pages.base_page import Page


class InstallationPage(Page):
    ele_title = (By.ID, u'page-installation-title')
    ele_advanced = (By.XPATH, u"//p[@data-tag='cardTitle']")
    ele_live_preview = (By.XPATH, u"//span[text()='Live Preview']")
    ele_error = (By.XPATH, 'hello')

    def __init__(self, driver, url, site_id):
        Page.__init__(self, driver, url)
        self.site_id = site_id
        self.url = url

    def installation_eles_check(self):
        self.find_element(*self.ele_title).is_enabled()
        self.find_element(*self.ele_advanced).is_enabled()
        self.find_element(*self.ele_live_preview).is_enabled()
